import java.util.Scanner;

public class Test {
    public static boolean huiwenshu(String s) {
        if(s==null){
            return false;
        }else{
            int i=0;
            int j=s.length()-1;
            s=s.toLowerCase();
            while(i<j){
                while(i<j&&!isCharacterorNumber(s.charAt(i))){
                    i++;
                }while(i<j&&!isCharacterorNumber(s.charAt(j))){
                    j--;
                }if(s.charAt(i)==s.charAt(j)){
                    i++;
                    j--;
                }else{
                    return false;
                }

            }
            return true;
        }
    }
    public static boolean isCharacterorNumber(char ch) {
        if((ch<='9'&&ch>='0')||(ch<='z'&&ch>='a')){
            return true;
        }else{
            return false;
        }
    }
    public static void main(String[] args) {
        Scanner scanner=new Scanner(System.in);
        while(scanner.hasNextLine()){
            String r=scanner.nextLine();
            boolean a=huiwenshu(r);
            System.out.println(a);
        }
    }
}
